package gecp.edge;

/**
 * Line
 *
 * @author Cosmin
 */
public class Line {

    /**
     * The start pixel location
     */
    public Location from;
    /**
     * The end pixel location
     */
    public Location to;

    /**
     * Construct a line without start and end pixel
     */
    public Line() {
        this.from = new Location();
        this.to = new Location();
    }

    /**
     * Construct a line with start pixel and without end pixel
     *
     * @param from The start pixel location
     */
    public Line(Location from) {
        this.from = from;
    }

    /**
     * Construct a line with start and end pixels
     *
     * @param from The start pixel location
     * @param to The end pixel location
     */
    public Line(Location from, Location to) {
        this.from = from;
        this.to = to;
    }

    /**
     * Construct a line with start pixel and without end pixel
     *
     * @param from_x The coordinate on x axis for the start pixel
     * @param from_y The coordinate on y axis for the start pixel
     */
    public Line(int from_x, int from_y) {
        this.from = new Location(from_x, from_y);
        this.to = new Location();
    }

    /**
     * Construct a line with start and end pixels
     *
     * @param from_x The coordinate on x axis for the start pixel
     * @param from_y The coordinate on y axis for the start pixel
     * @param to_x The coordinate on x axis for the end pixel
     * @param to_y The coordinate on y axis for the end pixel
     */
    public Line(int from_x, int from_y, int to_x, int to_y) {
        this.from = new Location(from_x, from_y);
        this.to = new Location(to_x, to_y);
    }
}

